package com.xiangban.yanglaodajie_admin.controller;

import com.xiangban.yanglaodajie_admin.aop.Permission;
import com.xiangban.yanglaodajie_admin.entity.OrdersClassOrActivity;
import com.xiangban.yanglaodajie_admin.entity.dto.OrdersClassOrActivityDto;
import com.xiangban.yanglaodajie_admin.entity.dto.RefundDto;
import com.xiangban.yanglaodajie_admin.entity.res.ApiResult;
import com.xiangban.yanglaodajie_admin.service.ClassOrActivityOrdersService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @Author Mr. MaYaYun
 * @Data 2021/6/28 17:01
 */
@RestController
@RequestMapping("/api/admin/orders_class_or_activity")
@Api(tags = "课程订单管理")
public class ClassOrActivityOrdersController {

    @Autowired
    private ClassOrActivityOrdersService classOrActivityOrdersService;

    @PostMapping("/getClassOrActivityOrders")
    @ApiOperation("获取课程订单列表")
    @Permission(permission = "admin:orders_class_or_activity:getClassOrActivityOrders")
    public ApiResult<Object> ClassOrActivityOrders(@RequestBody OrdersClassOrActivityDto ordersClassOrActivityDto){
        return ApiResult.newSuccess(classOrActivityOrdersService.ClassOrActivityOrders(ordersClassOrActivityDto));
    }

    @PostMapping("/getClassOrActivityOrderInfo")
    @ApiOperation("获取课程订单详情")
    @Permission(permission = "admin:orders_class_or_activity:getClassOrActivityOrderInfo")
    public ApiResult<Object> ClassOrActivityOrderInfo(@RequestBody OrdersClassOrActivity ordersClassOrActivity){
        return ApiResult.newSuccess(classOrActivityOrdersService.ClassOrActivityOrderInfo(ordersClassOrActivity));
    }

    @PostMapping("/getClassOrActivityStudents")
    @ApiOperation("课程学生报名信息")
    @Permission(permission = "admin:orders_class_or_activity:getClassOrActivityStudents")
    public ApiResult<Object> classOrActivityStudents(@RequestBody OrdersClassOrActivity ordersClassOrActivity){
        return ApiResult.newSuccess(classOrActivityOrdersService.classOrActivityStudents(ordersClassOrActivity));
    }



}
